package com.fu.core.util;

import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;

/**
 * @author 付龙江
 * @date 2022/1/27 21:44
 */
public class RestUtil {
    private static final RestTemplate restTemplate = new RestTemplate();

    public static  <T> T postWithParam(String uri, MultiValueMap<String,Object> param, Class<T> clazz){
        return restTemplate.postForObject(uri, param, clazz);
    }

    public static String postWithoutParam(String uri){
        return restTemplate.postForObject(uri, null, String.class);
    }
}
